package com.xiu.travel.handler;

import com.xiu.travel.util.WebUtils;
import com.xiu.travel.util.api.CommonResult;
import com.xiu.travel.util.api.ResultCode;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;

/**
 * @author yingyingying
 */
@Component
public class AccessDeniedHandlerImpl implements AccessDeniedHandler
{
    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException)
    {

        WebUtils.renderString(CommonResult.failed(ResultCode.FIND_NOT_RESULT));
    }
}


